import { findRegion, uploadImg, findPhoneCode } from '@/api/commons'

const commons = {
    actions: {
        // 获取地区
        FindRegion({ commit }, data) {
            return new Promise((resolve, reject) => {
                findRegion(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },
        UploadImg({ commit }, data) {
            return new Promise((resolve, reject) => {
                uploadImg(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },
        //获取手机验证码
        FindPhoneCode({ commit }, data) {
            return new Promise((resolve, reject) => {
                findPhoneCode(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        }
    }
}

export default commons
